package com.zhuoge.demo;

public class ExceptionDemo1 {
    public static void main(String[] args) {
        try {
            int[] arr = {1,2,3,4,5};
            System.out.println(arr[6]);
        }catch (ArrayIndexOutOfBoundsException a){
            String message = a.getMessage();
            System.out.println("message = " + message);
            String s = a.toString();
            System.out.println("s = " + s);
            a.printStackTrace();
        }
        finally {
            System.out.println("---");
        }
    }
}
